<?php

use Illuminate\Database\Seeder;
use App\Models\User;

class FollowersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $user=User::find(1);
        $users=User::all()->slice(1);
        $user_id=$user->id;
        $user_ids=$users->pluck('id')->toArray();

        $user->follow($user_ids);
        foreach ($users as $user){
            $user->follow($user_id);
        }

    }
}
